package com.lq.schoolshop.service.impl;

import com.lq.schoolshop.dao.PersonalCenterMapper;
import com.lq.schoolshop.pojo.Expand.OrdeExample;
import com.lq.schoolshop.pojo.Expand.OrderAndOrderDetailAndStore;
import com.lq.schoolshop.pojo.Expand.SendGoodStatus;
import com.lq.schoolshop.pojo.Order;
import com.lq.schoolshop.service.PersonalCenterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author
 * @Date2021/1/13 12:01
 * @Version V1.0
 * 为什么努力？想把钱都赚够，一心跳广场舞曲去。
 **/
@Service
public class PersonalCenterServiceImpl implements PersonalCenterService {

    @Autowired(required = false)
    private PersonalCenterMapper personalCenterMapper;


    @Override
    public List<OrderAndOrderDetailAndStore> selByAll(int uid) {
        return personalCenterMapper.selByAll(uid);
    }

    //用户的待发货状态 已发货状态 已完成状态
    @Override
    public SendGoodStatus selByWaitGoodsAndSendGoodAndFinish(int uid) {
        SendGoodStatus sendGoodStatus = new SendGoodStatus();
        int wait = personalCenterMapper.selByWaitSendGoods(uid);
        int sentGoods = personalCenterMapper.selBySentGoods(uid);
        int finish = personalCenterMapper.selByFinish(uid);
        sendGoodStatus.setWait(wait);
        sendGoodStatus.setFinish(finish);
        sendGoodStatus.setSend(sentGoods);
        return sendGoodStatus;
    }

    @Override
    public List<OrderAndOrderDetailAndStore> selNotSentByAll(int uid) {
        return personalCenterMapper.selNotSentByAll(uid);
    }

    @Override
    public List<OrderAndOrderDetailAndStore> selSentByAll(int uid) {
        return personalCenterMapper.selSentByAll(uid);
    }

    @Override
    public List<OrderAndOrderDetailAndStore> selSuccessSentByAll(int uid) {
        return personalCenterMapper.selSuccessSentByAll(uid);
    }


}
